1. Field of the Invention
The present invention relates to an image encoding apparatus which performs encoding of image data divided into a plurality of blocks, and particularly to a quantization control method for determining quantization information for each block.
2. Description of the Related Art
There has been widely known a method disclosed in TM5 (Test Model 5, Draft Revision 2) document as an encoding control method in the context of MPEG (Moving Picture Experts Group) encoding scheme, and is commonly used as a basis for designing MPEG encoding apparatuses and programs. As is well known, in the MPEG scheme, an image is transformed by the discrete cosine transform (DCT), which is a type of orthogonal transformation, into DCT coefficients. Each transformed DCT coefficient is quantized such that it is divided by a quantization scale (referred to hereinafter as “a Q-scale”) and its result is rounded. The quantized DCT coefficients are subjected to variable length coding (VLC) by which codes are sequentially allocated to the quantized DCT coefficients, to form a bit stream. The encoded stream of image information thus obtained is output together with header information about motion vectors, the Q-scale, and other parameters at a rate determined depending on the target bit rate.
The Q-scale used to quantize the DCT coefficients is usually controlled by a quantization control section. Quantization control is performed for two purposes: (1) the dependence of the amount of code generation on the target amount of codes, and (2) the reduction of image quality degradation. The dependence of the amount of code generation on the target amount is achieved by computing a basic Q-scale so as to reduce an error between the actual amount of code generation and the target amount of codes. Image quality degradation can be reduced by modulating the base Q-scale using a coefficient that indicates the complexity of the image. Such modulation utilizes the human vision characteristic whereby degradation is less perceptible in regions with complicated patterns, and is, conversely, more perceptible in flat regions.
For example, Japanese Laid-Open Patent Application No. 2001-025008 (paragraphs 0026 to 0028 of Specification; see FIG. 1) discloses a variable-rate motion image encoder wherein quantization control is performed in accordance with image complexity and the target amount of codes.